// c or c++.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>

using namespace std;

class cl
{
public:
	cl(int _i) : i(_i) {}
	cl(const cl& c)
	{
		i = c.i;
		cout << "copy constructor" << i << endl;
	}

	cl operator=(cl rhs)
	{
		cout << "assignment operation" << i << rhs.i << endl;
		this->i = rhs.i;
		return *this;
	}

	const cl& operator+(const cl &rhs)
	{
		this->i += rhs.i;
		return *this;
	}

	int i;
};

int _tmain(int argc, _TCHAR* argv[])
{
	cl c1(1);
	cl c2(2);
	const cl c3(3);

	cl c5 = c3;

	cl c4 = c1 + c2;

	return 0;
}
